import wx


class MyFrame(wx.Frame):
    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, title="创建StaticText类", pos=(100, 100), size=(600, 400))
        panel = wx.Panel(self, -1)
        # 创建标题，并设置字体
        title = wx.StaticText(panel, label='金庸小说集', pos=(100, 20))
        # font=wx.Font(16,wx.DEFAULT,wx.FONTSTYLE_NORMAL,wx.NORMAL_FONT)
        font = wx.Font()
        title.SetFont(font)
        # 创建文本
        wx.StaticText(panel, label='飞雪连天射白鹿', pos=(50, 50))
        wx.StaticText(panel, label='笑书神侠倚碧鸳', pos=(50, 70))


if __name__ == '__main__':
    app = wx.App()
    frame = MyFrame(parent=None, id=-1)
    frame.Show()
    app.MainLoop()